import java.util.List;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import dto.QuizzeDTO;
import beans.QuestionaireBeanRemote;


public class Main {
	public static void main(String[] args) {
	
		InitialContext ic;
		try {
			ic = new InitialContext();
		
			   final String JNDI = 
	                    "java:global/QuestionaireEAR/QuestionaireEJB/QuestionaireBean!beans.QuestionaireBeanRemote";
		QuestionaireBeanRemote qBean = (QuestionaireBeanRemote) ic.lookup(JNDI);
		List<QuizzeDTO> quizList = qBean.getAllQuizzes();
		
		for (QuizzeDTO quizzeDTO : quizList) {
			System.out.println("QuizName: " + quizzeDTO.getName() );
		}
		
		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}



}